cmake_minimum_required(VERSION 3.22)
project(Sofa.Component.Topology.Container LANGUAGES CXX)

set(SOFACOMPONENTTOPOLOGYCONTAINER_SOURCE_DIR "src/sofa/component/topology/container")

sofa_add_subdirectory_modules(SOFACOMPONENTTOPOLOGYCONTAINER_TARGETS
    DIRECTORIES Constant Dynamic Grid
)

set(HEADER_FILES
    ${SOFACOMPONENTTOPOLOGYCONTAINER_SOURCE_DIR}/config.h.in
    ${SOFACOMPONENTTOPOLOGYCONTAINER_SOURCE_DIR}/init.h
)

set(SOURCE_FILES
    ${SOFACOMPONENTTOPOLOGYCONTAINER_SOURCE_DIR}/init.cpp
)

add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} PUBLIC ${SOFACOMPONENTTOPOLOGYCONTAINER_TARGETS})

sofa_create_package_with_targets(
    PACKAGE_NAME ${PROJECT_NAME}
    PACKAGE_VERSION ${Sofa_VERSION}
    TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES
    INCLUDE_SOURCE_DIR "src"
    INCLUDE_INSTALL_DIR "${PROJECT_NAME}"
)
